package com.smbms.utils;

/**
 * @Description 描述
 * @Author 羽落陌殇
 * @Date 2021/7/16 16:48
 * @Version 1.0.0
 */
public class CaseUtils {
    // 首字母转小写
    public static String toLowerCaseFirstOne(String s) {
        if (Character.isLowerCase(s.charAt(0))) {
            return s;
        } else {
            return (new StringBuilder()
                    .append(Character.toLowerCase(s.charAt(0))))
                    .append(s.substring(1)).toString();
        }
    }

    // 首字母转大写
    public static String toUpperCaseFirstOne(String s) {
        if (Character.isUpperCase(s.charAt(0))) {
            return s;
        } else {
            return (new StringBuilder()
                    .append(Character.toUpperCase(s.charAt(0))))
                    .append(s.substring(1)).toString();
        }
    }
}
